import Vue from 'vue'
import VueRouter from 'vue-router'
//首页
import Home from '../views/Home.vue'
//导航设置
import set from '../components/set.vue'
//导航设置
import home_page from '../views/home_page.vue'
//轮播设置
import carousel from '../components/carousel.vue'
//页面管理
import page from '../components/page.vue'
//商品分类
import Category from '../components/Category.vue'
//商品列表
import catalogue from '../components/catalogue.vue'
//文章分类
import Categories from '../components/Categories.vue'
//文章列表
import ArticleList from '../components/ArticleList.vue'
//管理员设置
import Admin from '../components/Admin.vue'
//操作记录
import operating from '../components/operating.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: home_page
    // redirect: '/home/home_page',
  },
  {
    path: '/home',
    component: Home,
    children: [
      //页面
      {
        path: 'set',
        name: 'set',
        component: set
      },
      {
        path: 'carousel',
        name: 'carousel',
        component: carousel
      },
      {
        path: 'page',
        name: 'page',
        component: page
      },
      //商品
      {
        path: 'Category',
        name: 'Category',
        component: Category
      },
      {
        path: 'catalogue',
        name: 'catalogue',
        component: catalogue
      },
      {
        path: 'Categories',
        name: 'Categories',
        component: Categories
      },
      {
        path: 'ArticleList',
        name: 'ArticleList',
        component: ArticleList
      },
      {
        path: 'Admin',
        name: 'Admin',
        component: Admin
      },
      {
        path: 'operating',
        name: 'operating',
        component: operating
      },
    ]
  },


]

const router = new VueRouter({
  routes
})

export default router
